﻿using System;
using System.Globalization;
using System.Windows;
using System.Windows.Data;

namespace ProjectEuler.Data
{
    internal sealed class ProblemNumberToUriConverter : IValueConverter
    {
        private const String UrlTemplate = "http://ProjectEuler.net/index.php?section=problems&id={0}";

        public Object Convert(Object value, Type targetType, Object parameter, CultureInfo culture)
        {
            return String.Format(CultureInfo.InvariantCulture, UrlTemplate, value);
        }

        public Object ConvertBack(Object value, Type targetType, Object parameter, CultureInfo culture)
        {
            throw new NotSupportedException();
        }
    }
}
